package cn.chenhuanming.chuanzhi.util.entity;// default package

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * VoteOption entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "vote_option", catalog = "website")
@DynamicInsert
@DynamicUpdate
public class VoteOption implements java.io.Serializable {

	// Fields

	private Integer id;
	private Vote vote;
	private String name;
	private String approver;

	// Constructors

	/** default constructor */
	public VoteOption() {
	}

	/** minimal constructor */
	public VoteOption(Vote vote, String name) {
		this.vote = vote;
		this.name = name;
	}

	/** full constructor */
	public VoteOption(Vote vote, String name, String approver) {
		this.vote = vote;
		this.name = name;
		this.approver = approver;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "vote_id", nullable = false)
	public Vote getVote() {
		return this.vote;
	}

	public void setVote(Vote vote) {
		this.vote = vote;
	}

	@Column(name = "name", nullable = false)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "approver")
	public String getApprover() {
		return this.approver;
	}

	public void setApprover(String approver) {
		this.approver = approver;
	}

}